package com.example.aussiehealthhelper;

import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;

public class CommonPhonesActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_common_phones);

        RecyclerView rvPhoneList = findViewById(R.id.rvPhoneList);
        rvPhoneList.setLayoutManager(new LinearLayoutManager(this));

        PhoneListAdapter adapter = new PhoneListAdapter(getPhoneServices());
        rvPhoneList.setAdapter(adapter);
    }

    private List<PhoneService> getPhoneServices() {
        List<PhoneService> services = new ArrayList<>();

        // 添加电话号码
        services.add(new PhoneService("报警/消防/急救", "000"));
        services.add(new PhoneService("求助电话（备选）", "112"));
        services.add(new PhoneService("外交部", "0086101238"));
        services.add(new PhoneService("警察帮助", "1311444"));
        services.add(new PhoneService("免费翻译", "131450"));
        services.add(new PhoneService("道路救援", "131111"));
        services.add(new PhoneService("家暴求助", "1800737732"));
        services.add(new PhoneService("法律援助", "1300366424"));
        services.add(new PhoneService("移民局（境内）", "131881"));
        services.add(new PhoneService("移民局（境外）", "261960196"));
        services.add(new PhoneService("ATO（澳大利亚税务局）", "132861"));
        services.add(new PhoneService("大使馆", "0262283948"));

        return services;
    }
}